package com.caishi.lkx.exam.service;

import com.caishi.lkx.exam.model.EveryDayPracticeModel;
import com.caishi.lkx.exam.vo.EveryDaySectionListVo;
import com.zzw.common.entity.BSDService;


import java.time.LocalDate;
import java.util.List;

public interface IEveryDayPracticeService extends BSDService<EveryDayPracticeModel, String>, QuestionCollectionService<EveryDayPracticeModel, String> {

    /**
     * 获取某天的每日一练
     *
     * @param userId
     * @return
     */
    EveryDayPracticeModel todayPractice(String userId, Long categoryId, LocalDate date);

    /**
     * 获取某一天的每日一练
     *
     * @param userId
     * @param categoryId
     * @param date
     * @return
     */
    EveryDayPracticeModel adayDetail(String userId, Long categoryId, LocalDate date);


    /**
     * 获取时间区间内的每日一练
     *
     * @param startDate null时表示endDate前七天
     * @param endDate   不传时为当天
     * @return
     */
    List<EveryDaySectionListVo> sectionList(String userId, Long categoryId, LocalDate startDate, LocalDate endDate);

    /**
     * 获取某个科目某天的参与人数
     *
     * @param categoryId
     * @param day
     * @return
     */
    Integer getJoinCount(Long categoryId, LocalDate day);

    /**
     * 获取用连续学习天数
     *
     * @param userId
     * @return
     */
    Integer getContinuity(String userId);

}
